﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[Init_Buget] 
	-- Add the parameters for the stored procedure here
	@IDJurnal int , 
	@DataStart DateTime,
	@DataEnd DateTime,
	@ArtStart varchar(40),
	@ArtEnd varchar(40),
	@CodUnitate smallint
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	/*INSERT INTO [Buget]
           ([Denumire]
           ,[IDBugetParinte]
           ,[DataInceput]
           ,[DataSfarsit]
           ,[MultiAnual]
           ,[Rectificativ]
           ,[Suma]
           ,[IDJurnal],[ArtAl],[CodUnitate])    
    SELECT '',0,@DataStart,@DataEnd,CASE WHEN YEAR(@DataStart)<>YEAR(@DataEnd) THEN 1 ELSE 0 END AS [MultiAN],
    0,0,@IDJurnal,ArtAl,@CodUnitate 
    FROM ArticoleAliniate
	WHERE [Terminal] = 1 AND ([ArtAl] >= @ArtStart) AND ([ArtAl] <= @ArtEnd)
*/

END